export function getStorage(key) {
  const data = localStorage.getItem(key)

  try {
    return JSON.parse(data)
  } catch (err) {
    return data
  }
}

export function setStorage(key, value) {
  if (typeof value === 'object') {
    value = JSON.stringify(value)
  }
  localStorage.setItem(key, value)
}

export function removeStorage(key) {
  localStorage.removeItem(key)
}
